package com.jiaai.cloud.live.service.impl;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.jiaai.cloud.base.page.CustomPage;
import com.jiaai.cloud.live.entity.TAnchor;
import com.jiaai.cloud.live.entity.TAnchorSearch;
import com.jiaai.cloud.live.mapper.TAnchorMapper;
import com.jiaai.cloud.live.service.ITAnchorService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 主播基础信息表 服务实现类
 * </p>
 *
 * @author 佳爱网络科技
 * @since 2017-08-01
 */
@Service
public class TAnchorServiceImpl extends ServiceImpl<TAnchorMapper, TAnchor> implements ITAnchorService {
    /**
     * 查找主播列表
     * @param
     * @return
     */
    @Override
    public CustomPage<TAnchor> findAnchorFully(Page page, TAnchorSearch search) {
        page.setRecords(baseMapper.findAnchorFully(page, search));
        return new CustomPage(page);
    }

    @Override
    public CustomPage<TAnchor> findByAll(Page page, Wrapper wrapper) {
        page.setRecords(baseMapper.findByAll(page, wrapper));
        return new CustomPage(page);
    }
    /**
     * 删除主播列表
     * @param
     * @return
     */
    @Override
    public void delete(@Param("anchorId") String anchorId) {
        baseMapper.delete(anchorId);
    }

    @Override
    public List<TAnchor> findZhiboFully() {
        return baseMapper.findZhiboFully();
    }
    /**
     * 查找主播排行
     * @param
     * @return
     */
    @Override
    public CustomPage<TAnchor> anchorPaihang(Page page, Wrapper wrapper) {
        page.setRecords(baseMapper.anchorPaihang(page, wrapper));
        return new CustomPage(page);
    }


}
